package org.dromara.business.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.business.domain.ShoppingCart;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 购物车业务对象 shopping_cart
 *
 * @author zlj
 * @date 2024-08-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ShoppingCart.class, reverseConvertGenerate = false)
public class ShoppingCartBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long shoppingCartId;
    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;
    /**
     * 商品图片id
     */
    @NotNull(message = "商品图片id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long url;
    /**
     * 商品id
     */
    @NotNull(message = "商品id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long goodsId;
    /**
     * 商品价格
     */
    @NotNull(message = "商品价格不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal price;
    /**
     * 数量
     */
    @NotNull(message = "数量不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal num;
}
